﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Text;

namespace TrafficApp
{
    public class CarTL : TrafficLight
    {
        public CarTL(Vector Location, int Size, bool horizontal): base(Location,Size, horizontal)
        {
        }

        /// <summary>
        /// changes color
        /// </summary>
        public override void ChangeColor(colour state)
        {
            if (state == colour.Red)
            {
                clr = Color.Red;
                light = new Rectangle((int)Loc[0].X, (int)Loc[0].Y, size, size);
            }
            else if (state == colour.Green)
            {
                clr = Color.Green;
                light = new Rectangle((int)Loc[2].X, (int)Loc[2].Y, size, size);
            }
            else if (state == colour.Yellow)
            {
                clr = Color.Yellow;
                light = new Rectangle((int)Loc[1].X, (int)Loc[1].Y, size, size);
            }
        }
    }
}
